feat(notifications): push + email for collaborative-track invite/accept#60
Merged
Conversation
…te/accept Mirrors the manager-mode notification mappers for collaborative tracks. The api (discovery) trigger writes track_collaborator_invite / _accept rows to the notification table; this adds the pedalboard content for them. - trackCollaboratorInvite mapper: notifies the invited collaborator (browser + mobile push) — "<inviter> invited you to collaborate on <track>." - trackCollaboratorAccept mapper: notifies the inviter/owner (browser + mobile push) — "<collaborator> accepted your invitation to collaborate on <track>." - Registered both in mapNotifications; new data types in types/notifications. - Email-digest body text + component for both types (push is the focus; both also render in the daily/weekly digest, mirroring manager mode). - Mapper tests asserting the push + browser payloads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fetchEntities returns PlaylistInfo | TrackInfo; guard with 'title' in track (as usdcPurchaseSeller does) so .title type-checks. Fixes the notifications build (TS2339).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the notification content (push + email) for collaborative tracks, mirroring how manager mode works. Pairs with the api trigger (AudiusProject/api#932) that writes
track_collaborator_invite/track_collaborator_acceptrows to thenotificationtable, and the apps client (AudiusProject/apps#14466).Why this PR
The discovery trigger creates the notification rows, but the
pedalboard/apps/notificationsservice is what turns them into push (mobile + browser) and email. Without a mapper per type, these notifications would have no delivered content. This mirrorsrequestManager/approveManagerRequest.What's here
trackCollaboratorInvitemapper — notifies the invited collaborator: "<inviter> invited you to collaborate on <track>." (browser + mobile push; track title resolved viafetchEntities).trackCollaboratorAcceptmapper — notifies the inviter / track owner: "<collaborator> accepted your invitation to collaborate on <track>."mapNotifications.ts; data types added totypes/notifications.ts.approveManagerRequest(push-only); a transactional invite email can follow if desired.__tests__/mappings/) asserting the push + browser payloads, inserting the notification row directly (so no dependency on the discovery trigger in the test DB).Notification
datashape (from the api trigger){ track_id, collaborator_user_id, inviter_user_id }— numeric ids (the service reads the raw DB row, not the hashid'd HTTP response).Verification
App source typechecks clean (the only
tscerrors in this checkout are a pre-existing@types/babel__traverse/ tsc version skew, unrelated to these files). The mapper tests mirror the manager tests; CI provisions the discovery + identity test DBs.🤖 Generated with Claude Code